//
//  NSDate+Action.m
//  Zhibay
//
//  Created by peter on 15/2/8.
//  Copyright (c) 2015年 union. All rights reserved.
//

#import "NSDate+Action.h"
#import "NSString+Action.h"
static NSDateFormatter *dateFormatter;
@implementation NSDate (YWAction)
+ (NSString *)formatWithTimeInterval:(NSTimeInterval)timeInterval format:(NSString *)format {
    dateFormatter = [[NSDateFormatter alloc] init];
    dateFormatter.dateFormat = ![NSString isInValidString:format] ? format :@"yyyy-MM-dd HH:mm:ss";
    NSDate *currentDate = [NSDate dateWithTimeIntervalSince1970:timeInterval];
    return [dateFormatter stringFromDate:currentDate];
}


@end
